﻿package com.spx;

public interface LTrans{
	/**不翻转*/
	public static final byte TRANS_NONE=0;
	/**顺时针翻转90度*/
	public static final byte TRANS_ROT90=5;
	/**顺时针翻转180度*/
	public static final byte TRANS_ROT180=3;
	/**顺时针翻转270度*/
	public static final byte TRANS_ROT270=6;
	/**镜像*/
	public static final byte TRANS_MIRROR=2;
	/**顺时针镜像翻转90度*/
	public static final byte TRANS_MIRROR_ROT90=7;
	/**顺时针镜像翻转180度*/
	public static final byte TRANS_MIRROR_ROT180=1;
	/**顺时针镜像翻转270度*/
	public static final byte TRANS_MIRROR_ROT270=4;
	
	public static final int TRANS_X_FLIP=0x02;
	public static final int TRANS_Y_FLIP=0x01;
	public static final int TRANS_INVERTED_AXES=0x04;
	
	//transfrom table
    public static final byte[][] TRANSFORM_TABLE = new byte[ /*8*/][ /*8*/]{
        {TRANS_NONE, TRANS_MIRROR_ROT180, TRANS_MIRROR, TRANS_ROT180,
        TRANS_MIRROR_ROT270, TRANS_ROT90, TRANS_ROT270, TRANS_MIRROR_ROT90},
        {TRANS_MIRROR_ROT180, TRANS_NONE, TRANS_ROT180, TRANS_MIRROR, TRANS_ROT90,
        TRANS_MIRROR_ROT270, TRANS_MIRROR_ROT90, TRANS_ROT270},
        {TRANS_MIRROR, TRANS_ROT180, TRANS_NONE, TRANS_MIRROR_ROT180, TRANS_ROT270,
        TRANS_MIRROR_ROT90, TRANS_MIRROR_ROT270, TRANS_ROT90},
        {TRANS_ROT180, TRANS_MIRROR, TRANS_MIRROR_ROT180, TRANS_NONE,TRANS_MIRROR_ROT90,
        TRANS_ROT270, TRANS_ROT90, TRANS_MIRROR_ROT270},
        {TRANS_MIRROR_ROT270, TRANS_ROT270, TRANS_ROT90, TRANS_MIRROR_ROT90,TRANS_NONE,
        TRANS_MIRROR, TRANS_MIRROR_ROT180, TRANS_ROT180},
        {TRANS_ROT90, TRANS_MIRROR_ROT90, TRANS_MIRROR_ROT270, TRANS_ROT270,
        TRANS_MIRROR_ROT180, TRANS_ROT180, TRANS_NONE, TRANS_MIRROR},
        {TRANS_ROT270, TRANS_MIRROR_ROT270, TRANS_MIRROR_ROT90, TRANS_ROT90,
        TRANS_MIRROR, TRANS_NONE, TRANS_ROT180, TRANS_MIRROR_ROT180},
        {TRANS_MIRROR_ROT90, TRANS_ROT90, TRANS_ROT270, TRANS_MIRROR_ROT270,TRANS_ROT180,
        TRANS_MIRROR_ROT180, TRANS_MIRROR, TRANS_NONE}
    };
    //rotate table
    public static final byte ROTATE_TABLE[][]=new byte[ /*8*/][ /*4*/]{
        {TRANS_ROT270,TRANS_ROT90,TRANS_MIRROR,TRANS_MIRROR_ROT180},
        {TRANS_MIRROR_ROT90,TRANS_MIRROR_ROT270,TRANS_ROT180,TRANS_NONE},
        {TRANS_MIRROR_ROT270,TRANS_MIRROR_ROT90,TRANS_NONE,TRANS_ROT180},
        {TRANS_ROT90,TRANS_ROT270,TRANS_MIRROR_ROT180,TRANS_MIRROR},
        {TRANS_MIRROR_ROT180,TRANS_MIRROR,TRANS_ROT90,TRANS_ROT270},
        {TRANS_NONE,TRANS_ROT180,TRANS_MIRROR_ROT270,TRANS_MIRROR_ROT90},
        {TRANS_ROT180,TRANS_NONE,TRANS_MIRROR_ROT90,TRANS_MIRROR_ROT270},
        {TRANS_MIRROR,TRANS_MIRROR_ROT180,TRANS_ROT270,TRANS_ROT90}
    };

	final static public float ANGLE_90=(float)(Math.PI/2);
	final static public float ANGLE_270=(float)(Math.PI*3/2);
	  /**
     * Constant for centering text and images horizontally
     * around the anchor point
     *
     * <P>Value <code>1</code> is assigned to <code>HCENTER</code>.</P>
     */
    public static final int HCENTER = 1;
  
    /**
     * Constant for centering images vertically
     * around the anchor point.
     *
     * <P>Value <code>2</code> is assigned to <code>VCENTER</code>.</P>
     */
    public static final int VCENTER = 2;
  
    /**
     * Constant for positioning the anchor point of text and images
     * to the left of the text or image.
     *
     * <P>Value <code>4</code> is assigned to <code>LEFT</code>.</P>
     */
    public static final int LEFT = 4;
  
    /**
     * Constant for positioning the anchor point of text and images
     * to the right of the text or image.
     *
     * <P>Value <code>8</code> is assigned to <code>RIGHT</code>.</P>
     */
    public static final int RIGHT = 8;
  
    /**
     * Constant for positioning the anchor point of text and images
     * above the text or image.
     *
     * <P>Value <code>16</code> is assigned to <code>TOP</code>.</P>
     */
    public static final int TOP = 16;

    /**
     * Constant for positioning the anchor point of text and images
     * below the text or image.
     *
     * <P>Value <code>32</code> is assigned to <code>BOTTOM</code>.</P>
     */
    public static final int BOTTOM = 32;
  
    /**
     * Constant for positioning the anchor point at the baseline of text.
     *
     * <P>Value <code>64</code> is assigned to <code>BASELINE</code>.</P>
     */
    public static final int BASELINE = 64;

    /**
     * Constant for the <code>SOLID</code> stroke style.
     *
     * <P>Value <code>0</code> is assigned to <code>SOLID</code>.</P>
     */
    public static final int SOLID = 0;

    /**
     * Constant for the <code>DOTTED</code> stroke style.
     *
     * <P>Value <code>1</code> is assigned to <code>DOTTED</code>.</P>
     */
    public static final int DOTTED = 1;
}
